#! /bin/sh
# building a model with "unif2"

hsfile=hsseis.out

# Use the Marmousi model
zcat $CWPROOT/src/demos/Velocity_Profiles/Marmousi/marmhard.dat.gz |
a2b n1=1 | smooth2 n1=122 n2=384 r1=5 r2=5 > velocity.1


# build the file of densities
unif2 < model.unif2 ninf=6  nx=384 nz=122 dx=10 \
v00=1.0,2.25,2.25,2.25,2.35,2.35,2.35 dz=20 > density.1

# view the model
ximage < velocity.1 title="velocity profile" legend=1 \
xbox=10 ybox=10 wbox=768 hbox=244 n1=122 n2=384 d1=10 d2=10 &
ximage < density.1 title="density profile" legend=1 \
xbox=750 ybox=10 wbox=768 hbox=244 n1=122 n2=384 d1=10 d2=10 &

# finite difference modeling
sufdmod2_pml < velocity.1 pml_thick=8 xs=2000 zs=20 nx=384 nz=122 dx=10 dz=10 \
dfile=density.1 fmax=80 tmax=12.0 nt=3001 hsz=10 hsfile=$hsfile abs=1,1,1,1 \
verbose=2 mt=10 > cube.out

# view image
suximage < cube.out n1=122 n2=384 d1=10 d2=10 loop=1 width=768 height=244 &

exit 0
